#include<stdio.h>
int main()
{
	int m;
	scanf("%d",&m);
	printf("%d",m/100+m%10+m/10%10);
	return 0;
}
